if (strcmp(fmp->key, "PATH_SPEED") == 0) {
WAYPT_SET(wpt, speed, atof(s));
} else
+ if (strcmp(fmp->key, "PATH_SPEED_KPH") == 0) {
+ WAYPT_SET(wpt, speed, KPH_TO_MPS(atof(s)));
+ } else
+ if (strcmp(fmp->key, "PATH_SPEED_MPH") == 0) {
+ WAYPT_SET(wpt, speed, MPH_TO_MPS(atof(s)));
+ } else
if (strcmp(fmp->key, "PATH_COURSE") == 0) {
WAYPT_SET(wpt, course, atof(s));
} else
if (strcmp(fmp->key, "PATH_SPEED") == 0) {
writebuff( buff, fmp->printfc, wpt->speed );
} else
+ if (strcmp(fmp->key, "PATH_SPEED_KPH") == 0) {
+ writebuff( buff, fmp->printfc, MPS_TO_KPH(wpt->speed));
+ } else
+ if (strcmp(fmp->key, "PATH_SPEED_MPH") == 0) {
+ writebuff( buff, fmp->printfc, MPS_TO_MPH(wpt->speed));
+ } else
if (strcmp(fmp->key, "PATH_COURSE") == 0) {
writebuff( buff, fmp->printfc, wpt->course );
} else
#define SECONDS_PER_HOUR (60L*60)
#define SECONDS_PER_DAY (24L*60*60)
+/* meters/second to kilometers/hour */
+#define MPS_TO_KPH(a) ((double)(a)*SECONDS_PER_HOUR/1000)
+/* meters/second to miles/hour */
+#define MPS_TO_MPH(a) (METERS_TO_MILES(a) * SECONDS_PER_HOUR)
+/* kilometers/hour to meters/second */
+#define KPH_TO_MPS(a) ((double)(a)*1000/SECONDS_PER_HOUR)
+/* miles/hour to meters/second */
+#define MPH_TO_MPS(a) (MILES_TO_METERS(a) / SECONDS_PER_HOUR)
+
/*
* Snprintf is in SUS (so it's in most UNIX-like substance) and it's in
* C99 (albeit with slightly different semantics) but it isn't in C89.
</screen>
</section>
+<section id="style_def_pathspeed_kph">
+<title>PATH_SPEED_KPH</title>
+<para>
+ Like PATH_SPEED but means kilometers per hour.
+</para>
+<para>
+example:
+</para>
+<screen format="linespecific"> PATH_SPEED_KPH,"","%.1f"
+</screen>
+</section>
+
+<section id="style_def_pathspeed_mph">
+<title>PATH_SPEED_MPH</title>
+<para>
+ Like PATH_SPEED but means miles per hour.
+</para>
+<para>
+example:
+</para>
+<screen format="linespecific"> PATH_SPEED_MPH,"","%.1f"
+</screen>
+</section>
+
<section id="style_def_pathcourse">
<title>PATH_COURSE</title>
<para>